<template>
    <div class="user-collect">
        name:
        <h1>{{$store.state.name}}</h1>
        <van-button type="default" @click="click">点击</van-button>
    </div>
</template>

<script>
    import {ApiService} from "../../../axios/apiService";
    export const user= new ApiService('/user')
    export default {
        props: {
        },
        created(){
            user.getViewById(1).then(res=>{
                console.log(res);
            })
        },
        methods:{
          click(){
             console.log("change");
             this.$store.commit('changeName','sdasda')
          }
        }
    };
</script>
